package com.supconit.kqfx.web.fxzf.channel.dao.Impl;

import com.supconit.kqfx.web.fxzf.channel.dao.ChannelDao;
import com.supconit.kqfx.web.fxzf.channel.entities.Channel;
import hc.orm.AbstractBasicDaoImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ChannelDaoImpl extends AbstractBasicDaoImpl<Channel, String> implements ChannelDao {

    private static final String NAMESPACE = Channel.class.getName();

    public ChannelDaoImpl() {
    }

    protected String getNamespace() {
        return NAMESPACE;
    }

    public int getCount(Channel channel) {
        return ((Integer) this.selectOne("getCount", channel)).intValue();
    }

    public void deleteByUserId(Channel channel) {
        this.delete("deleteByUserId", channel);
    }

    @Override
    public List<Channel> getAllChannel() {
        return selectList("getAllChannel");
    }
}
